package com.springboot.demo.order;

import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.Date;

@RestController
@RequestMapping(path = "/order")
public class OrderController {

    @RequestMapping("{orderId}")
    public Order GetOrderById(@PathVariable("orderId") Integer orderId) {
        Order order = new Order();
        order.setOrderId(orderId);
        order.setAmount(100d);
        order.setCreateTime(new Date());
        order.setCreateUserId(1);
        order.setState(OrderStateEnum.Paied);

        return order;
    }
}
